package com.meritit.config.jvm;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class DemoThread extends Thread{

	static class Hello{
		static {
			System.out.println(Thread.currentThread().getName() + " init ...");
			try {
				Thread.sleep(3000);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
	}
	
	@Override
	public void run() {
		System.out.println(Thread.currentThread().getName() + " start ...");
		Hello h = new Hello();
		System.out.println(Thread.currentThread().getName() + " end ...");
	}
	
	public static void main(String[] args) {
		
		ExecutorService pool = Executors.newFixedThreadPool(10);
		
		for(int i = 0; i < 30; i++) {
			pool.execute(new DemoThread());
		}
		
	}
	
}
